<?php
/*
 * Created on 2014-7-14
 */

require_once(TIN_APP_PATH . 'include/TinAppController.php');

class AppService extends TinAppController {
	
	public function __construct() {
		
	}
	/** 测试接口 */
	public function HelloWord($data){
		$data['data'] = "Hello Word.";
		return $this->echoRes($data, $data["type"], 'HelloWord');
	}
	/** 返回指定类型的数据
	 * @param $data 数组数据
	 * @param $type 返回数据格式 json/xml，默认json
	 * @param $rootname XML首节点的名称,默认DATA
	 *  */
	public function echoRes($data, $type='json', $rootname="DATA"){
		return $this->getResources($data, $type, $rootname);
// 		if($type=="json"){
// 			return json_encode($data);
// 		}else{
// 			return Xml::array2xml($data, $rootname);
// 		}
	}
	
} 
?>
